//
//  UIView+ZZExtension.h
//  BabyDiscern
//
//  Created by mac on 2019/5/6.
//  Copyright © 2019 mac. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (ZZExtension)
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@property (nonatomic, assign) CGFloat top;
@property (nonatomic, assign) CGFloat bottom;
@property (nonatomic, assign) CGFloat left;
@property (nonatomic, assign) CGFloat right;

/// 获取 LaunchScreenView
+(nullable UIView *)getLaunchScreenView;

/// 颜色转图片
+ (UIImage *)imageFromColor:(UIColor *)color scaleToSize:(CGSize)size;

/// 裁圆角
-(void)circleView;
-(void)circleViewByCornerRadii:(CGSize)cornerRadii;
-(void)circleViewByRoundingCorners:(UIRectCorner)corners;
-(void)circleViewByRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii;

/**
 * 裁剪身份证图片
 * @param imageView 相机展示的视图
 * @param cutView 裁剪框视图
 * @retrun 裁剪后的图片
 */
+(UIImage *)selectImage:(UIImage *)image andImageView:(UIView *)imageView andCutView:(UIView *)cutView;


/* 高精度文字识别 */
+ (NSString *)getTextSuccessWithResult:(id)result;

+(NSString *)contentTypeForImageData:(NSData *)data;

+ (NSString *)urlEncodeStr:(NSString *)input;
 
//获得当前活动窗口的根视图
+ (nullable UIViewController *)findCurrentShowingViewController;

//添加单边阴影
//shadowColor 阴影颜色
//shadowOpacity 阴影透明度，默认0
//shadowRadius 阴影半径，默认3
//shadowPathType 阴影加边类型 0 上边 1下边 2左边 3右边 4左右 5上下 6 上和左右 7 下和左右
//shadowPathWidth 阴影路径宽度
- (void)viewShadowPathWithColor:(UIColor *)shadowColor shadowOpacity:(CGFloat)shadowOpacity shadowRadius:(CGFloat)shadowRadius shadowPathType:(NSInteger)shadowPathType shadowPathWidth:(CGFloat)shadowPathWidth;
@end

NS_ASSUME_NONNULL_END
